class Father:
  def cure(self):
    print("中医")

class Son:
  def cure(self):
    print("西医")

class Patient:
  def need_cure(self, doctor):
    # 只用中医
    if isinstance(doctor, Father):
      doctor.cure()
    else:
      print("该患者不适用西医，请用中医治疗")


d1 = Father()
d2 = Son()

p1 = Patient()
p1.need_cure(d2)


# 检查对象的类型
# print(isinstance(d1, Father))

# 检查是否是子类

